<!DOCTYPE HTML>
<html lang="en">
<head>
  <meta name="copyright" content=
  "Copyright (c) IBM Corporation and others 2000, 2009. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.">
  <meta charset="utf-8">
  <link rel="STYLESHEET" href="../book.css" type="text/css">
  <title>Committing</title>
  <meta name="keyword" content="team">
</head>
<body>
  <h1 class="Head">Committing</h1>
  <p>You can commit Workbench resources that you have modified to the repository so that other team members can see
  your work. Only those changes committed on that branch will be visible to others working on that branch. The commit
  command can be issued from two places: the <b>Team &gt; Commit</b> menu, or the <b>Synchronize</b> view.</p>
  <h2>Committing Changes Using<b>Team &gt; Commit</b></h2>
  <ol>
    <li>In one of the navigation views, select the resources that you want to commit.</li>
    <li>Right-click on the resources and select <b>Team &gt; Commit</b> from the pop-up menu.</li>
    <li>If there are new files whose file types cannot be determined automatically, the first page of the Commit dialog
    will present the unknown types and allow you to set them appropriately to either ASCII or binary. Click
    <strong>Next</strong> to continue.</li>
    <li>On the Comment page, provide a comment for your changes (for example, <samp>Fixed the spelling
    mistakes</samp>).</li>
  </ol>
  <p>You can preview files that are about to be committed from the Comment page. If any of the files are known to be
  conflicting changes, the commit will not be allowed. If there are no known conflicting changes the commit will be
  allowed but there could still be conflicting changes on the server (i.e. conflicting changes on the server become
  known to the client during a synchronize operation). If there are conflicting changes on any files that are
  committed, the operation will fail. If this occurs, you must either perform an update or use the Synchronize view to
  resolve the conflicts. It is considered a more ideal workflow to always update before committing in order to ensure
  that you have the latest state of the repository before committing more changes.</p>
  <p>If one or more of the resources being committed are new and not yet added to VCS control, they will be added
  automatically unless they are explicitly removed by choosing <strong>Remove from View</strong> from the context
  menu.</p>
  <h2>Committing Changes in the Synchronize View</h2>
  <ol>
    <li>In one of the navigation views, select the resources that you want to commit.</li>
    <li>Right-click to open the pop-up menu and select <b>Team &gt; Synchronize with Repository</b>. The Synchronize
    view will open.</li>
    <li>On the toolbar of the Synchronize view, select the <b>Outgoing mode</b> button to show any modified Workbench
    resources (outgoing changes) that you may have.</li>
    <li>If there are conflicts (red arrows), resolve them. To do so open them in a Compare editor and use the text
    compare area to merge resources with conflicts. You can copy changes from the repository revision of the file to
    the Workbench revision of the file and save the merged Workbench resource. Once all the conflicts in the Structure
    Compare area have been resolved, perform a <strong>Mark as Merged</strong> on the resource in the Synchronize view
    to make the change an outgoing change and you are ready to commit.</li>
    <li>In the Structure Compare pane, right-click the top of the hierarchy that you want to commit, and select
    <b>Commit</b> from the pop-up menu.</li>
    <li>In the Commit Comment dialog box, provide a comment for your changes (for example, <samp>Fixed the spelling
    mistakes</samp>). Again, if there are new files of an unknown type, you will be asked to specify what type they
    should be.</li>
  </ol>
  <p><em>Tip:</em> You can commit files that are in conflict by performing an <b>Override and Commit</b>. This will
  commit the Workbench copy of the resource into the repository and thus remove any of the incoming changes.</p>
  <p><em>Warning:</em> The behavior of the <b>Override and Commit</b> command described above only applies to the
  outgoing mode of the Synchronize view. In the <b>Incoming/Outgoing mode</b> of the view, the behavior for outgoing
  changes and conflicts is the same but the command will revert incoming changes to whatever the local Workbench
  contents are. Exercise great caution if using this command in incoming/outgoing mode.</p>
  <h3 class="related">Related Tasks</h3>
  <a href="tasks-113b.htm">Resolving conflicts</a><br>
  <a href="tasks-68.htm">Comparing resources</a><br>
  <a href="tasks-100d.htm">Version control life cycle: adding and ignoring resources</a>
</body>
</html>
